package Servlet;

import javaBean.Detail;
import useBean.DetailDB;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

/**
 * <p>Title: ReplyDetail</p>
 * <p>author 12427</p>
 *
 * @version ver1.0
 * @date 2021/12/22 17:08
 */
@WebServlet("/ReplyDetail")
public class ReplyDetail  extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        // TODO Auto-generated method stub
        String url ="/MessageDetail.jsp";
        request.setCharacterEncoding("utf-8");
        List<Detail> dL = null;
        try {
             dL = DetailDB.selectU();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }

        request.setAttribute("DetailList", dL);
        getServletContext().getRequestDispatcher(url).forward(request, response);
    }
}


